package com.edu.imau.ManagerSeat;

import com.edu.imau.ManagerRoleInformation.Manager;
import com.edu.imau.ParkingDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/update4")
public class SeatUpdateServlet extends HttpServlet {
    private ParkingDao dao =new ParkingDao();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1：接收请求 处理参数
        String seat_id = request.getParameter("seat_id");
        //2:调用model
        if(seat_id != null){
            Seat seat = dao.getSeatById(Integer.parseInt(seat_id));
            //3:展示view
            request.setAttribute("seat",seat);
            request.getRequestDispatcher("seatmanager.jsp").forward(request,response);
        }

    }
}